package com.edu.whty.service;

import com.edu.whty.entity.base.Pagination;
import com.edu.whty.entity.disk.DiskGrowthTrend;
import com.edu.whty.entity.disk.DiskOwner;
import com.edu.whty.entity.disk.FolderDTO;
import com.github.pagehelper.PageInfo;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @auther xiongxiaofei
 * @date 2016/11/14
 */
public interface DiskService {

    /**
     * 创建网盘属主资源
     * @param params
     * @return
     * @throws Exception
     */
    String createDiskOwnerResource(Map<String, Object> params) throws Exception;

    List<DiskOwner> queryDiskOwner(DiskOwner diskOwner)throws  Exception;

    void removeResource(DiskOwner diskOwner) throws Exception;

    void saveDiskOwnerBatch(List<DiskOwner> list) throws Exception;

    DiskOwner  getDiskOwner(String resId) throws Exception;

    String createFolder(FolderDTO folderDTO) throws Exception;

    int selectDiskExists(String dirId) throws Exception;

    void batchUpdateDiskOwner(List<DiskOwner> list) throws Exception;

    void renameFolder(FolderDTO folderDTO) throws Exception;

    void updateDiskOwner(DiskOwner diskOwner) throws Exception;

    Long getOrgCapacity(String orgId) throws Exception;

    Long getUserCapacity(String userId) throws Exception;

    PageInfo selectUserCapacityListInPage(HashMap<String,Object> map, Pagination pagination) throws Exception;

    /**
     * 根据条件查询已使用容量
     * @param model
     * @return
     * @throws Exception
     */
    Long getCapacityByCondition(DiskOwner model) throws Exception;

    /**
     * 统计最近30天的文件增长变化，每天一条数据，没有数据的点补0，按人或按学校都行
     * @param model
     * @return
     * @throws Exception
     */
    List<DiskGrowthTrend> getGrowthTrendByDay(DiskOwner model) throws Exception;

    /**
     * 统计最近12周的文件增长变化，每周一条数据，没有数据的点补0，按人或按学校都行
     * @param model
     * @return
     * @throws Exception
     */
    List<DiskGrowthTrend> getGrowthTrendByWeek(DiskOwner model) throws Exception;

    /**
     * 统计最近6个月的文件增长变化，每半个月一条数据，没有数据的点补0，按人或按学校都行
     * @param model
     * @return
     * @throws Exception
     */
    List<DiskGrowthTrend> getGrowthTrendByHalfMonth(DiskOwner model) throws Exception;

    /**
     * 统计最近12个月的文件增长变化，每月一条数据，没有数据的点补0，按人或按学校都行
     * @param model
     * @return
     * @throws Exception
     */
    List<DiskGrowthTrend> getGrowthTrendByMonth(DiskOwner model) throws Exception;

    void insert(DiskOwner diskOwner) throws Exception;
}
